<?php
    $this->load->view('wx/public/header.html', [
        'time' => time(),
        'index' => 4,
        'css' => [
            'assets/wx/css/center.css',
        ]
    ]);
?>

<body class="center cash" ng-controller="wx-center-cashin-controller">

<div class="aui-content aui-margin-b-15">
    <ul class="aui-list aui-media-list">
        <li class="aui-list-item aui-list-item-middle">
            <a href="/center/cashinDetail" class="aui-media-list-item-inner">
                <div class="aui-list-item-media icon-area"></div>
                <div class="aui-list-item-inner aui-list-item-arrow">
                    <div class="aui-list-item-text">
                        <div class="aui-list-item-title aui-font-size-14" style="line-height: 25px; color: #666;">充值明细</div>
                    </div>
                </div>
            </a>
        </li>
    </ul>
</div>

<section class="aui-grid aui-margin-b-15 meals">
    <h3 class="aui-padded-l-10 meals-title">请选择充值金额（元）</h3>
    <div class="aui-row">
        <div class="aui-col-xs-4" ng-repeat="m in meals">
            <div class="aui-grid-label" ng-click="chooseItem(m)" ng-class="{'active': m.selected && !customData.use}" ng-bind="m.name"></div>
        </div>
        <div class="aui-col-xs-4">
            <div class="aui-grid-label" ng-class="{'custom': !customData.use,'custom_active': customData.use}" ng-click="customPanel()">自定义</div>
        </div>
    </div>
    <p class="aui-padded-l-10 meals-footer">
        已选: <span ng-bind="customData.use ? '自定义金额 ' + customData.amount_show + ' 元' : '套餐' + selectedItem.name"></span>
    </p>
</section>

<div class="aui-content aui-margin-b-15 pay-way">
    <ul class="aui-list aui-list-in">
        <li class="aui-list-header aui-border-b">
            <i class="aui-iconfont aui-icon-down aui-pull-right aui-margin-r-15"></i>
            充值方式
        </li>
        <li class="aui-list-item">
            <div class="aui-list-item-inner pay-way-list">
                <div class="aui-list-item-title">
                    <i class="aui-iconfont aui-icon-wechat"></i>
                    <span>微信支付</span>
                </div>
                <div class="aui-list-item-right">
                    <input type="radio" class="aui-radio gu-btn-bg" checked>
                </div>
            </div>
        </li>
    </ul>

    <div class="aui-btn aui-btn-default aui-btn-block aui-btn-sm aui-margin-t-15 aui-margin-l-15 aui-margin-r-15"
         ng-click="doCashIn()"
         ng-class="{'gu-btn-bg': !isLoading}"
            >立即充值</div>
</div>

<!--自定义支付-->
<div class="aui-popup aui-popup-bottom gu-c-alert" id="customAmount">
    <div class="aui-popup-content gu-c-alert-pannel">
        <div class="aui-row aui-row-padded gu-c-alert-box">
            <div class="aui-tips aui-margin-b-15 aui-bg-danger" ng-show="customData.showError" id="tips-1">
                <i class="aui-iconfont aui-icon-info"></i>
                <div class="aui-tips-title" ng-bind="customData.errorMsg"></div>
                <i class="aui-iconfont aui-icon-close"></i>
            </div>

            <div class="aui-card-list aui-margin-b-15">
                <div class="aui-card-list-header" style="color: #757575;">
                    支付金额
                </div>
                <div class="aui-card-list-content-padded gu-cashout-money">
                    <input type="number" placeholder="0.00" ng-model="customData.amount_format" style="font-size: 30px; color: #000;">
                </div>
                <div class="aui-card-list-footer aui-border-t" ng-bind="'提示: 单次充值金额需小于 '+ limitAmount.amount_format +' 元'"></div>
            </div>

            <div class="aui-padded-l-15 aui-padded-r-15 aui-margin-t-15">
                <div class="aui-btn aui-btn-block gu-btn-bg gu-text-default"
                     ng-click="useCustomAmount()" style="color: #ffffff;">确定</div>
            </div>
        </div>
    </div>
</div>

<?php
    $this->load->view('wx/public/footer.html', [
        'js' => [
            'assets/library/aui/script/aui-popup.js',
            'assets/wx/js/center/cash/cashin.js'
        ]
    ]);
?>

